package com.cloud.drore.eboss.login.feign;

import com.cloud.drore.eboos.common.base.ResultMessage;
import com.cloud.drore.eboss.login.user.UserAndFunction;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 浙江卓锐科技股份有限公司 版权所有 © Copyright 2018<br>
 *
 * @Description: <br>
 * @Project: eboos <br>
 * @CreateDate: Created in 2018/1/6 17:38 <br>
 * @Author: <a href="836327318@qq.com">吴昌益</a>
 */
@FeignClient("eboss-sso")
public interface ILoginFeign {

    @RequestMapping(value = "login", method = RequestMethod.POST)
    String login(ShiroUser user);

    @RequestMapping(value = "admin/user/password", method = RequestMethod.POST)
    ResultMessage password(PasswordReset user);

    @RequestMapping(value = "admin/user/{id}", method = RequestMethod.GET)
    ShiroUserVo findById(@PathVariable("id") Long id);

    @RequestMapping(value = "admin/user/{id}", method = RequestMethod.GET)
    ShiroUser findUserById(@PathVariable("id") Long id);

    @RequestMapping(value = "admin/user_function/{id}", method = RequestMethod.GET)
    UserAndFunction findUserFunctionById(@PathVariable("id") Long id);

    @RequestMapping(value = "/admin/getUserByUserName", method = RequestMethod.POST)
    ShiroUser findByUsername(ShiroUser shiroUser);

    @RequestMapping(value = "/admin/getUserByUserName", method = RequestMethod.POST)
    ShiroUserVo findByUsernameVo(ShiroUser shiroUser);

    @RequestMapping(value = "/admin/editUser", method = RequestMethod.POST)
    ResultMessage editUser(ShiroUser shiroUser);

    @RequestMapping(value = "/admin/addUser", method = RequestMethod.POST)
    ResultMessage addUser(@RequestBody ShiroUser shiroUser);

    @RequestMapping(value = "/admin/addUserAndRight", method = RequestMethod.POST)
    ResultMessage addUserAndRight(@RequestBody UserAndFunction userAndFunction);

    @RequestMapping(value = "/admin/updateUserAndRight", method = RequestMethod.PUT)
    ResultMessage updateUserAndRight(UserAndFunction userAndFunction);

    @RequestMapping(value = "/admin/function_list/{project}", method = RequestMethod.GET)
    ResultMessage findFunctionManagerList(@PathVariable("project") String project);

    @RequestMapping(value = "/admin/user_list/{type}/{typeId}", method = RequestMethod.GET)
    ResultMessage findUserList(@PathVariable("type") String type, @PathVariable("typeId") Long typeId);

    @RequestMapping(value = "/admin/resetPassword/{id}", method = RequestMethod.GET)
    ResultMessage resetPassword(@PathVariable("id") Long id);

    @RequestMapping(value = "/admin/disableUser/{id}/{status}", method = RequestMethod.GET)
    ResultMessage disableUser(@PathVariable("id") Long id, @PathVariable("status") int status);

}
